class Solution1 {
    public static void main(String[] args) {
        int[] nums = {-1,0,3,5,9,12};
        int target = 13 ;
        System.out.println(search(nums, target));
        int a = 1 ;
        int b = 2 ;
        int[] nums1 =new int[] {a<b?a:b , b > a ?a:b};
    }
    public static int search(int[] nums, int target) {
       for(int left = 0 ,right=nums.length-1 ; left <= right ; ){
         int mid=(left+right)/2 ;
           if(nums[mid] == target){
            return mid ;
           }
           if(nums[mid] > target){
             right = mid -1 ;
           }else{
              left = mid+1 ;
           }
       }
           return -1 ;

    }
}